import { createApp } from "vue";
import App from "./App.vue";
import Toast, { POSITION, type PluginOptions } from "vue-toastification";
import "vue-toastification/dist/index.css";
import "./assets/toast.css";
import store from "./store/index"; // 导入 Pinia
import router from "./router"; // 导入路由实例

const app = createApp(App);

// 配置选项
const toastOptions: PluginOptions = {
  position: POSITION.TOP_CENTER,
  timeout: 3000,
  closeOnClick: true,
  pauseOnFocusLoss: false,
  pauseOnHover: false,
  draggable: true,
  draggablePercent: 0.6,
  showCloseButtonOnHover: false,
  hideProgressBar: true,
  closeButton: "button",
  icon: false, // 禁用默认图标，我们将使用自定义
  transition: "Vue-Toastification__bounce",
  toastClassName: "custom-toast",
};

app.use(store); // 使用 Pinia
app.use(router); // 确保这里注册了路由

// 应用插件
app.use(Toast, toastOptions);

app.mount("#app");
